home *** CD-ROM | disk | FTP | other *** search
- Path: munta.cs.mu.OZ.AU!fjh
- From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
- Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu
- Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada)
- Date: 8 Apr 1996 20:11:16 GMT
- Organization: Comp Sci, University of Melbourne
- Message-ID: <4kbrt5$k3h@mulga.cs.mu.OZ.AU>
- References: <JSA.96Feb16135027@organon.com> <dewar.828879781@schonberg> <4k9qhe$65r@solutions.solon.com> <dewar.828936837@schonberg> <4kb2j8$an0@solutions.solon.com>
- NNTP-Posting-Host: munta.cs.mu.oz.au
-
- seebs@solutions.solon.com (Peter Seebach) writes:
-
- >Robert Dewar <dewar@cs.nyu.edu> wrote:
- >>THe original issue was the semantic behavior
- >>of read. Unlike other unices, in Linux, the bounds check for the read
- >>buffer is based on the requested count, rather than the actual count
- >>of data bytes read. It is hard to say either approach is right or
- >>wrong, but they are different enough to cause portability problems.
- >
- >How? No offense meant, but any code which can be affected by this is flat
- >out broken.
-
- It is clear that (a) such code is broken and (b) the fact that
- it has undefined behaviour causes portability problems.
- What you said and what Robert Dewar said are not contradictory.
-
- >I can't see how this is a "portability problem" any more than it's a
- >portability problem that some systems will crash on
- > printf("%s", (char *) 0);
- >... (SunOS won't, though.)
-
- It is not *more* of a portability problem than `printf("%s", (char *) 0);',
- but the undefined behaviour of read() and printf() both cause portability
- problems.
-
- >Something which works only on some systems is
- >not a portability problem *if there is no standard saying it works*. Likewise
- > i = ++i;
- >producing different results on different machines is not a "portability
- >problem".
-
- Ha! Obviously you have never tried porting any serious C programs.
-
- >(This applies to most of the C standard library, as well, of course. The
- >behavior you're used to, such as "void main(void)" or "fflush(stdin)" not
- >working, is not a portability problem, it's broken code.)
-
- It's a portability problem AND it's broken code.
-
- --
- Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
- WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
- PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.
-